home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows News 2010 Summer - Disc 1
/
WN_Ete2010_CD1.iso
/
Onglet5
/
Weezo
/
Weezo setup.exe
/
{code_appDir}
/
www
/
js
/
mExplorer-src.js
< prev
next >
Wrap
Text File
|
2010-05-19
|
6KB
|
177 lines
var files;
var fS=-1;
var imgx; var imgw; var imgh;
function ffn(){if(W.files && files[fS]) return files[fS][1]}
function go(n){
if(mcRIP) return;
mwl.liSel(n);
fas(n.childNodes[1].childNodes[0].innerHTML,'go',"","",'async');
}
function selI(n,go){return '<tr id="'+n+'" onclick="'+vA[n][0]+'"><td class="lil"><img src="'+vA[n][1]+'" alt="" class="frLi2"></td><td class="lic"><span class="lits">'+vA[n][2]+'</span></td><td class="lir">'+((go)?'<img src="'+icoGo+'">':' ')+'</td></tr>'}
// Files browsing select/unselect
function sel(n,act){
//if('tr'+fS==n.id) return;
mwl.liSel(n);
fS=n.id.substr(2);
var f=files[n.id.substr(2)];
var c='<div class="frame1Header">'+f[1]+'</div><br><table class="liTable" cellspacing=0 cellpadding=0><colgroup><col width="1%"><col width="98%"><col width="1%"></colgroup>';
if(f[3]==1) c+=selI('dlBt');
if(f[4]) c+=selI('mdlBt');
if(f[3]) c+=selI('plBt',1);
if(f[7]===1) c+=selI('renBt');
if(f[8]===1) c+=selI('exeBt');
if(f[6]===1) c+=selI('supBt');
updtView(c+"</table>");
}
// Download
function dl(n){
d=D.comForm.data1.value;dlt='';
if(typeof n=='string') f=n;
else{
mwl.liSel(n);
f=ffn()
}
for(var i=0;i<d.length;i++) dlt+=d.charCodeAt(i);
for(var i=0;i<f.length;i++) dlt+=f.charCodeAt(i);
var tu="/dl/dlToken"+dlt+'/resId'+resId+'/'+d+'/'+f;
if(n.id)setTimeout('mwl.liUnsel("'+n.id+'")',500);
D.location=tu.replace(/#/gi,"*weezoSharp*").replace(/\&/gi,"*weezoAmp*").replace(/\+/gi,"*weezoPlus*").replace(/\%/gi,"*weezoPercent*").replace(/ /gi,"%20");
}
// Add to playlist (o='pl) or multiple download list (o!='pl')
function mAdd(n,o){
if(n) {
mwl.liSel(n);
if(o=='pl') fS=n.id.substr(2);
}
//while(!n.id||n.id.substr(0,2)!='tr') n=n.parentNode;
fas(ffn(),(o=='pl')?'plAdd':'mAdd');
setTimeout('mwl.liUnsel("'+n.id+'")',500);
}
// View file
function view(n){
if(n) mwl.liSel(n);
if(fS==-1&&n.id) {fS=n.id.substr(2);ufs=1}
fas((ffn())?ffn():n,'view','firstLoad',screen.availWidth+"x"+screen.availHeight,'sync')
if(W.ufs) fS=-1;
}
// Execute a file on server
function exe(n) {
mwl.liSel(n);
p=prompt(capExe,"");
if(p!=undefined) fas(ffn(),"exe",p,'async');
mwl.liUnsel(n);
}
// Rename a file
function ren(n) {
mwl.liSel(n);
w=prompt(capRen,ffn().replace(/ /g,' ').replace(/&/g,'&'));
if (w) fas(ffn(),"ren", w.replace(/&/g,'&')); else mwl.liUnsel(n);
}
// Delete a file or a folder
function sup(n) {
mwl.liSel(n);
if(!confirm(capSup.replace('%1',ffn()))) return mwl.liUnsel(n);
fas(ffn(),"sup","","");
}
// Remote download
function rdl() {
if((url=dgi('rdlInput').value)=="") return;
mwl.liSel(dgi('rdlBt'));
dgi('rdlInput').value="";
setTimeout('us("rdlBt")',1500);
fillAndSubmit(url,"rdl","","",'async');
}
// Clear multiple downloads list
function mSuppAll(){fas('','mSuppAll');dgi('mdlF').innerHTML=''}
function mAddAll(n){
if(n) {mwl.liSel(n); if(n.id)setTimeout('mwl.liUnsel("'+n.id+'")',500);}
fas('','mAddAll')
}
function plPlayAll(){fas('*playlist*.m3u','view','','',W.inlinePlayer?'async':'sync')}
// Start download of all selected files
function mDownload(){fas('','mDownload','','','sync')}
// Upload
function ul(){
if(!dgi('ubId').value) return;
dgi('ulDir').value=D.comForm.data1.value;
dgi('postUlFile').value=dgi('ubId').value;
D.comForm.data2.value=dgi('ubId').value;
D.comForm.data3.value='uploadCheckOverwrite';
asyncSubmit();
}
function initUploadProceed(a,c){
if(a=='forbidden') return alert(c);
if(a=='confirm' && !confirm(c)) return;
sendData('uploadGetId=1&preUlFile='+encodeURIComponent(dgi('ubId').value)+'&preUlDir='+encodeURIComponent(dgi('ulDir').value))
}
function doUploadFile(uploadId){
dgi('ulTransferId').value=uploadId;
dgn('UPLOAD_IDENTIFIER').value=uploadId;
D.uploadForm.submit();
}
function setPos(n,d){
if(mcRIP) return;
mwl.liSel(n);
fas('','setPos',d,'','async');
}
/**
* Highlight button corresponding to current view
*/
function setViewIco(){
var a;
if(a=dgi('setViewFolders')) a.className=(eV=='folders')?'btSel':'bt';
if(a=dgi('setViewFiles')) a.className=(eV=='files')?'btSel':'bt';
if(a=dgi('setViewTools')) a.className=(eV=='tools')?'btSel':'bt';
}
/**
* Set current view type: Highlight button and refresh view
* d: view type 'folders', 'files', 'tools'
* n (optional): list item node to be highlighted
*/
function setView(d,n){
if(mcRIP) return;
eV=d;
setViewIco();
if(n) mwl.liSel(n);
fas('','setView',d,'','async');
}
function liSep(){return '<tr><td> </td><td></td><td></td></tr>'}
function updtFolders(nf,fiIcon,fiTxt,fl,prev,next){
D.comForm.data1.value=nf;
if(fiIcon==undefined) return;
if(eV!='folders') {eV='folders';setViewIco()}
var goImg='/themes/mobile/go.gif';
var out='<div class="frame1Header">'+nf.replace(/\*resourceBasePath\*/,'')+'</div>';
out+='<table class="liTable" cellspacing=0 cellpadding=0><colgroup><col width="1%"><col width="98%"><col width="1%"></colgroup>';
out+='<tr class="li" onclick="mwl.liSel(this);setView(\'files\',this)">';
out+='<td class="lil"><img src="'+fiIcon+'" class="frLi2"></td>';
out+='<td class="lic">'+fiTxt+'</td>';
out+='<td class="lir"><img src="'+goImg+'"></td></tr>';
out+=liSep();
if(prev && fl.length>0 && fl[0]!='..') out+='<tr class="li" onclick="setPos(this,\'prev\')"><td class="lil"> </td><td class="lic" style="text-align:center"><img src="'+icoSup+'"></td><td class="lir"> </td></tr>';
for(i=0;i<fl.length;i++) {
out+='<tr class="li" id="tr'+i+'" onclick="go(this)">';
out+='<td class="lil"><img src="'+((typeof fl[i]=='string')?icoFold:fl[i][1])+'" class="frLi2" height=32 width=32></td>';
label=((typeof fl[i]=='string')?fl[i]:fl[i][0]);
out+='<td class="lic"><div class="lits">'+label+'</div></td>';
out+='<td class="lir"><img src="'+goImg+'"></td></tr>';
if(label=='..'){
out+=liSep();
if(prev) out+='<tr class="li" onclick="setPos(this,\'prev\')"><td class="lil"> </td><td class="lic" style="text-align:center"><img src="'+icoSup+'"></td><td class="lir"> </td></tr>';
}
}
if(next) out+='<tr class="li" onclick="setPos(this,\'next\')"><td class="lil"> </td><td class="lic" style="text-align:center"><img src="'+icoSdown+'"></td><td class="lir"> </td></tr>';
updtView(out+'</table>')
}
function updtView(t){
dgi('mainDiv').innerHTML=t;
if(t&&!dgi('mainDiv').innerHTML) D.location.reload();
}